-
-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add egg-pumpkin.json #425
base: master
Are you sure you want to change the base?
Add egg-pumpkin.json #425
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding the installation script here to make it readable for everyone:
#!/bin/ash
set -eux
apk add --no-cache musl-dev git
mkdir -p /mnt/server
REPO_URL="${GIT_URL:-https://github.com/Snowiiii/Pumpkin.git}"
if [ -n "$GIT_BRANCH" ]; then
git clone --depth 1 --single-branch --branch "$GIT_BRANCH" "$REPO_URL"
else
git clone --depth 1 --single-branch "$REPO_URL"
fi
if [ -n "$GIT_COMMIT" ]; then
git checkout "$GIT_COMMIT"
fi
cd Pumpkin
if [[ "$BUILD_RELEASE" == "1" || "$BUILD_RELEASE" == "true" ]]; then
cargo build --release
strip target/release/pumpkin
cp target/release/pumpkin /mnt/server/pumpkin
else
cargo build
cp target/debug/pumpkin /mnt/server/pumpkin
fi
egg-pumpkin.json
Outdated
}, | ||
"scripts": { | ||
"installation": { | ||
"script": "#!\/bin\/ash\r\nset -eux\r\n\r\napk add --no-cache musl-dev git\r\nmkdir -p \/mnt\/server\r\n\r\nREPO_URL=\"${GIT_URL:-https:\/\/github.com\/Snowiiii\/Pumpkin.git}\"\r\n\r\nif [ -n \"$GIT_BRANCH\" ]; then\r\n git clone --depth 1 --single-branch --branch \"$GIT_BRANCH\" \"$REPO_URL\"\r\nelse\r\n git clone --depth 1 --single-branch \"$REPO_URL\"\r\nfi\r\n\r\nif [ -n \"$GIT_COMMIT\" ]; then\r\n git checkout \"$GIT_COMMIT\"\r\nfi\r\n\r\ncd Pumpkin\r\n\r\nif [[ \"$BUILD_RELEASE\" == \"1\" || \"$BUILD_RELEASE\" == \"true\" ]]; then\r\n cargo build --release\r\n strip target\/release\/pumpkin\r\n cp target\/release\/pumpkin \/mnt\/server\/pumpkin\r\nelse\r\n cargo build\r\n cp target\/debug\/pumpkin \/mnt\/server\/pumpkin\r\nfi", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cargo build
command will build a generic image, since this will most likely be deployed on server with one specific set of hardware we can add additional instructions to optimize for this server's hardware. Through setting the following environment variables:
RUSTFLAGS="-C target-feature=-crt-static -C target-cpu=native"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably need to tweak the images a bit
Error loading shared library libgcc_s.so.1: No such file or directory (needed by ./pumpkin)
Error relocating ./pumpkin: _Unwind_Resume: symbol not found
Error relocating ./pumpkin: _Unwind_GetTextRelBase: symbol not found
Error relocating ./pumpkin: _Unwind_GetIPInfo: symbol not found
Error relocating ./pumpkin: _Unwind_GetIP: symbol not found
Error relocating ./pumpkin: _Unwind_SetGR: symbol not found
Error relocating ./pumpkin: _Unwind_GetLanguageSpecificData: symbol not found
Error relocating ./pumpkin: _Unwind_Backtrace: symbol not found
Error relocating ./pumpkin: _Unwind_GetRegionStart: symbol not found
Error relocating ./pumpkin: _Unwind_SetIP: symbol not found
Error relocating ./pumpkin: _Unwind_RaiseException: symbol not found
Error relocating ./pumpkin: _Unwind_GetDataRelBase: symbol not found
Error relocating ./pumpkin: _Unwind_DeleteException: symbol not found
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, I was honestly wondering on if the pumpkin executable could run without libgcc. I guess this answers that.
What we'd need to do is provide our own runtime container with libgcc installed. I had done that in my own repository for a pumpkin egg however I didn't bother building an ARM64 variant. Which the alpine yolk has.
@Snowiiii would you be fine with adding another container image for Pumpkin to run on Pterodactyl?
Probably tagged along the lines of ghcr.io/snowiiii/pumpkin:yolk
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So as of my understanding, We then have 2 images. One without libgcc, And one with libgcc packaged ?. Isn't there a way to just install libgcc in the script ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At best 3 images
- normal pumpkin on alpine
- yolk based on ghcr.io/pterodactyl/yolks:alpine
- installer based on ghcr.io/pterodactyl/installers:alpine
(and maybe add a scratch and Debian image later on)
What have you done exactly to test it? I don't see anything specified in regards to that. Even though docker is supposed to allow for one and the same environment to be replicate able across machines, I've found out that this may not always be the case. |
I ran it on Windows 11 WSL Debian bookworm. |
Windows (dies inside) |
Need to play league of legends and I don't want to clutter my Debian server. I also have a dual boot with fedora, but I have not used it for a while. |
This is in docker's nature, because its repeatable and not reproducible, there is no way around this while using docker, i suggest we at least test it on macos, linux and windows before pushing this into master |
We don't need to because Pterodactyl only supports Linux, see https://pterodactyl.io/wings/1.0/installing.html#supported-systems |
I've tested this on my server and as long as the installation memory set in your Pterodactyl wing to a sufficient high number 4GB is probably best. It'll install just fine from there. |
2gb should be enough, that's why I added "Requires around 2GB RAM to build, adjust docker.installer_limits.memory in your wing accordingly!" to the desc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me this is ready to ship, haven't had the libgcc
issues that @Commandcracker has experienced.
Only slightly confusing thing is that there's no feedback of the installation process having finished (though the install banner disappears in Pterodactyl).
So perhaps a small echo to mention that the install is finished is in order.
Description
Add egg for Pterodactyl
Testing
Please follow our Coding Guidelines